package io.renren.modules.app.controller;

import java.util.Arrays;
import java.util.Map;

import io.renren.common.utils.PageUtils;
import io.renren.common.utils.R;
import io.renren.modules.app.service.ShopinfoService;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import com.zheok.testing.entity.ShopinfoEntity;



/**
 * 商户信息
 *
 * @author ææ¢
 * @email 2863751700@qq.com
 * @date 2022-08-23 14:28:04
 */
@RestController
@RequestMapping("testing/shopinfo")
public class ShopinfoController {
    @Autowired
    private ShopinfoService shopinfoService;

    /**
     * 列表
     */
    @RequestMapping("/list")
   //@RequiresPermissions("testing:shopinfo:list")
    public R list(@RequestParam Map<String, Object> params){
        PageUtils page = shopinfoService.queryPage(params);

        return R.ok().put("page", page);
    }


    /**
     * 信息
     */
    @RequestMapping("/info/{id}")
   //@RequiresPermissions("testing:shopinfo:info")
    public R info(@PathVariable("id") Long id){
		ShopinfoEntity shopinfo = shopinfoService.getById(id);

        return R.ok().put("shopinfo", shopinfo);
    }

    /**
     * 保存
     */
    @RequestMapping("/save")
   //@RequiresPermissions("testing:shopinfo:save")
    public R save(@RequestBody ShopinfoEntity shopinfo){


		shopinfoService.saveinfo(shopinfo);

        return R.ok();
    }

    /**
     * 修改
     */
    @RequestMapping("/update")
   //@RequiresPermissions("testing:shopinfo:update")
    public R update(@RequestBody ShopinfoEntity shopinfo){
		shopinfoService.saveinfo(shopinfo);

        return R.ok();
    }

    /**
     * 删除
     */
    @RequestMapping("/delete")
   //@RequiresPermissions("testing:shopinfo:delete")
    public R delete(@RequestBody Long[] ids){
		shopinfoService.removeByIds(Arrays.asList(ids));

        return R.ok();
    }

}
